package com.yang.design.behavior.observe;

/**
 * 具体观察者
 */
public class ConcreteObserver implements Observer {

    //观察者自己一些成员变量
    private String name;

    public ConcreteObserver(String name) {
        this.name = name;
    }

    @Override
    public void update(int state) {
        //具体的业务逻辑,这里就简单写了一个输出语句
        System.out.println("观察者" + this.name + "已经收到,状态已经发生修改!,state = " + state);
    }
}
